/*
 * 题目描述：判断一个十进制数转换进制之后是否对称
 *
 * 输入：N 数字 base 进制
 *
 * 输出：Yes or No
 *      base进制表示
 *
 * 注意：0永远是对称的
 */
#include <iostream>
#include <sstream>
#include <vector>

using namespace std;
int num,base;

vector<string> transform(){
    vector<string> v;
    string res;
    stringstream ss;
    while(num!=0){
        ss << num%base;
        ss >> res;
        ss.clear();
        v.push_back(res);
        num/=base;
    }
    return v;
}

bool judge(vector<string> v){
    for (int j = 0; j < v.size(); ++j) {
        if (v[j] != v[v.size() - 1 - j]) {
            return false;
        }
    }
    return true;
}
int main() {
    cin >> num >> base;
    if(num == 0){
        cout << "Yes\n";
        cout << "0";
    }else{
        vector<string> v = transform();
        if (judge(v)) {
            cout << "Yes\n";
        }else{
            cout << "No\n";
        }
        for(int i = v.size() - 1; i >= 0; i--) {
            cout << v[i];
            if (i != 0) {
                cout << " ";
            }
        }
    }
    return 0;
}